/*
* 数字动态计数器
* */
import CountUp from 'countup.js'

const options = {
  useEasing: true,
  useGrouping: true,
  separator: ',',
  decimal: '.'
}

const count = (id, endNum, time) => {
  let goStart = new CountUp(id, 0, endNum, 0, time, options)
  if (!goStart.error) {
    goStart.start()
  } else {
    console.error(goStart.error)
  }
}

export default count
